package com.ccp.dev.system.model;

import com.ccp.dev.core.basic.model.BaseModel;

/**
 * 对象功能:总分类表 Model对象
 *
 * @author caishaofan
 */
public class GlobalType extends BaseModel<GlobalType> {
	/**
	 * 表分类
	 */
	public static final String CAT_TABLE="TABLE_TYPE";

	/**
	 * 流程分类
	 */
	public static final String CAT_FLOW="FLOW_TYPE";
	/**
	 * 表单类型
	 */
	public static final String CAT_FORM="FORM_TYPE";
	
	/**
	 * 文件类型
	 */
	public static final String CAT_FILE = "FILE_TYPE";
	
	/**
	 * 附件类型
	 */
	public static final String CAT_ATTACH = "ATTACH_TYPE";
	
	/**
	 * 字典类型(数据字典)
	 */
	public final static  String CAT_DIC="DIC";
	
	/**t
	 * 分类类型--附件文件格式
	 */
	public static final String CAT_FILE_FORMAT = "FILEFORMAT";
	
	/**
	 * 分类类型--报表
	 */
	public static final String CAT_REPORT="REPORT_TYPE";
	
	/**
	 * 分类类型--数据字典
	 */
	public static final String NODE_KEY_DIC="DIC";	
	
	/**
	 * 分类类型--首页栏目
	 */
	public static final String CAT_INDEX_COLUMN="INDEX_COLUMN_TYPE";
	
	
	/**
	 * 流程分类根节点的名称
	 */
	public static final String TYPE_NAME_BPM="流程分类";

	/**
	 * 数据字典在sys_gl_type 中的类型名称
	 */
	public final static  String TYPE_NAME_DIC="数据字典";
	
	/**
	 * 树型数据 type=1
	 */
	public final static Integer DATA_TYPE_TREE=1;
	/**
	 * 平铺数据 type=0
	 */
	public final static Integer DATA_TYPE_FLAT=0;

	/**
	 * 根结点的父ID（重要）
	 */
	public final static long ROOT_PID=-1;

	/**
	 * 根结点的ID
	 */
	public final static long ROOT_ID=0;
	
	/**
	 * 根结点的深度
	 */
	public final static long ROOT_DEPTH=0;
	
	/**
	 *  是否父类
	 */
	public final static String IS_PARENT_N="false";
	public final static String IS_PARENT_Y="true";

	/**
	 * 是否叶子(0否,1是)
	 */
	public final static int IS_LEAF_N=0;
	public final static int IS_LEAF_Y=1;

	/**
	 * 自编码生成方式(0	手工录入,1自动生成)
	 */
	public final static String NODE_CODE_TYPE_AUTO_N="0";
	public final static String NODE_CODE_TYPE_AUTO_Y="1";

	/**
	 * 分类id
	 */
	private String typeId;

	/**
	 * 分类名称
	 */
	private String typeName;

	/**
	 * 节点路径
	 */
	private String nodePath;

	/**
	 * 层次
	 */
	private Integer depth;

	/**
	 * 父节点
	 */
	private String parentId;

	/**
	 * 节点的分类Key
	 */
	private String nodeKey;

	/**
	 * 点分类的Key，如产品分类Key为PT
	 */
	private String catKey;

	/**
	 * 层次
	 */
	private Long sn;

	/**
	 * 所属用户
	 */
	private String userId;

	/**
	 * 所属部门
	 */
	private String depId;

	/**
	 * 类型(0平铺,1树形)
	 */
	private Integer type=0;

	/**
	 * 是否叶子结点(0否,1是),主要用于数据库保存
	 */
	private Integer isLeaf;

	/**
	 * 节点的自编码
	 */
	private String nodeCode;

	/**
	 * 节点的自编码生成方式
	 */
	private Short nodeCodeType=0;

	/**
	 * 是否找开
	 */
	private String open="true";


	/**
	 * 是否父类,主要用于树的展示时用
	 */
	private String isParent;

	/**
	 * 子节点的个数
	 */
	private int childNodes=0;

	public String getTypeId() {
		return typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getNodePath() {
		return nodePath;
	}

	public void setNodePath(String nodePath) {
		this.nodePath = nodePath;
	}

	public Integer getDepth() {
		return depth;
	}

	public void setDepth(Integer depth) {
		this.depth = depth;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getNodeKey() {
		return nodeKey;
	}

	public void setNodeKey(String nodeKey) {
		this.nodeKey = nodeKey;
	}

	public String getCatKey() {
		return catKey;
	}

	public void setCatKey(String catKey) {
		this.catKey = catKey;
	}

	public Long getSn() {
		return sn;
	}

	public void setSn(Long sn) {
		this.sn = sn;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getDepId() {
		return depId;
	}

	public void setDepId(String depId) {
		this.depId = depId;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getIsLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(Integer isLeaf) {
		this.isLeaf = isLeaf;
	}

	public String getNodeCode() {
		return nodeCode;
	}

	public void setNodeCode(String nodeCode) {
		this.nodeCode = nodeCode;
	}

	public Short getNodeCodeType() {
		return nodeCodeType;
	}

	public void setNodeCodeType(Short nodeCodeType) {
		this.nodeCodeType = nodeCodeType;
	}

	public String getOpen() {
		return open;
	}

	public void setOpen(String open) {
		this.open = open;
	}

	public String getIsParent() {
		return this.childNodes>0?"true":"false";
	}

	public void setIsParent(String isParent) {
		this.isParent = isParent;
	}

	public int getChildNodes() {
		return childNodes;
	}

	public void setChildNodes(int childNodes) {
		this.childNodes = childNodes;
	}

	@Override
	public String toString() {
		return "GlobalType{" +
				"typeId='" + typeId + '\'' +
				", typeName='" + typeName + '\'' +
				", nodePath='" + nodePath + '\'' +
				", depth=" + depth +
				", parentId='" + parentId + '\'' +
				", nodeKey='" + nodeKey + '\'' +
				", catKey='" + catKey + '\'' +
				", sn=" + sn +
				", userId='" + userId + '\'' +
				", depId='" + depId + '\'' +
				", type=" + type +
				", isLeaf=" + isLeaf +
				", nodeCode='" + nodeCode + '\'' +
				", nodeCodeType=" + nodeCodeType +
				", open='" + open + '\'' +
				", isParent='" + isParent + '\'' +
				", childNodes=" + childNodes +
				", createBy='" + createBy + '\'' +
				", createTime=" + createTime +
				", updateTime=" + updateTime +
				", updateBy='" + updateBy + '\'' +
				", tenantId='" + tenantId + '\'' +
				'}';
	}
}